package stream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * 将两个流对象合并为一个流
 */
public class StreamConcat {
    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2);
        List<Integer> list2 = Arrays.asList(3, 4);
        Stream.concat(list.stream(), list2.stream()).forEach(System.out::println);
    }
}
